Skip to content

Check cpu features more portably in test_libs.sh#758

Merged
mhucka merged 1 commit into
masterfrom
mh-improve-test-libs-script
Jun 13, 2025
Merged

Check cpu features more portably in test_libs.sh#758
mhucka merged 1 commit into
masterfrom
mh-improve-test-libs-script

Conversation

@mhucka
Copy link
Copy Markdown
Collaborator

@mhucka mhucka commented Jun 12, 2025

The previous commands to get cpu features on Windows failed on GitHub Windows-2022 runners. It seems the underlying commands used by the script changed. The new approach in this commit uses the Python py-cpuinfo package, which works on Windows and has the bonus of working on Mac and Linux too, allowing us to simply the test_libs.sh further.

@mhucka mhucka marked this pull request as draft June 12, 2025 16:06
The previous commands to get cpu features on Windows failed on GitHub
Windows-2022 runners. It seems the underlying commands used by the
script changed. The new approach in this commit uses the Python
`py-cpuinfo` package, which works on Windows and has the bonus of
working on Mac and Linux too, allowing us to simply the test_libs.sh
further.
@mhucka mhucka force-pushed the mh-improve-test-libs-script branch from f6e8388 to 8cba9aa Compare June 12, 2025 16:58
@mhucka mhucka requested review from dstrain115 and pavoljuhas June 12, 2025 18:31
@mhucka mhucka marked this pull request as ready for review June 12, 2025 18:32
@mhucka mhucka requested a review from sergeisakov June 13, 2025 15:57
@mhucka mhucka merged commit aa6a2c7 into master Jun 13, 2025
14 of 19 checks passed
@mhucka mhucka deleted the mh-improve-test-libs-script branch June 13, 2025 20:22
mhucka added a commit that referenced this pull request Jun 18, 2025
The documented way that `bazel build`, `bazel test`, and similar
commands behave without options like `--config=avx` is that the AVX,
SSE, and other optimization options are not applied. However, this was
not what was happening: the default ended up applying them. The
previous changes to `.bazelrc` and `dev_tools/test_libs.sh` that I did
in PR #758 and other recent PRs not fully address this.

The changes here invert the way `--build_tag_filters` and
`--test_tag_filters` are used: they are set to filter out things
tagged with `avx` and `sse` by default in `.bazelrc`, and options like
`--config=sse` add the things back.

To make this work, `dev_tools/test_libs.sh` has to be updated as well.
mhucka added a commit that referenced this pull request Jun 18, 2025
The documented way that `bazel build`, `bazel test`, and similar
commands behave without options like `--config=avx` is that the AVX,
SSE, and other optimization options are not applied. However, this was
not what was happening: the default ended up applying them. The
previous changes to `.bazelrc` and `dev_tools/test_libs.sh` that I did
in PR #758 and other recent PRs not fully address this.

The changes here invert the way `--build_tag_filters` and
`--test_tag_filters` are used: they are set to filter out things
tagged with `avx` and `sse` by default in `.bazelrc`, and options like
`--config=sse` add the things back.

To make this work, `dev_tools/test_libs.sh` has to be updated as well.
mhucka added a commit that referenced this pull request Jun 18, 2025
The documented way that `bazel build`, `bazel test`, and similar
commands behave without options like `--config=avx` is that the AVX,
SSE, and other optimization options are not applied. However, this was
not what was happening: the default ended up applying them. The
previous changes to `.bazelrc` and `dev_tools/test_libs.sh` that I did
in PR #758 and other recent PRs not fully address this.

The changes here invert the way `--build_tag_filters` and
`--test_tag_filters` are used: they are set to filter out things
tagged with `avx` and `sse` by default in `.bazelrc`, and options like
`--config=sse` add the things back.

To make this work, `dev_tools/test_libs.sh` has to be updated as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants